package com.cyf.plc.constant

class Constants {

    companion object {

        const val SYSTEM_WIND_ID = 100
        const val SYSTEM_MODE_ID = 102
        const val SYSTEM_POWER_ID = 104
        const val SYSTEM_OUT_HOME_ID = 106
        const val SYSTEM_ENERGY_CONSERVATION_ID = 108
        const val SYSTEM_WARN1_ID = 126
        const val SYSTEM_WARN2_ID = 128

        const val SENSOR_TEMP_ID = 1014
        const val SENSOR_HUMIDITY_ID = 1016
        const val SENSOR_PM25_ID = 1018
        const val SENSOR_VOC_ID = 1020
        const val SENSOR_CO2_ID = 1022

        const val SETTING_ENERGY = 1248
        const val SETTING_WORK_TIME_SWITCH = 1252
        const val SETTING_HOLIDAY_TIME_SWITCH = 1254
        const val SETTING_WORK_CLOCK_START = 1256
        const val SETTING_WORK_CLOCK_END = 1260
        const val SETTING_HOLIDAY_CLOCK_START = 1264
        const val SETTING_HOLIDAY_CLOCK_END = 1268

        const val PANEL_TEMP_ID = 132
        const val PANEL_HUMIDITY_ID = 136
        const val PANEL_SWITCH_ID = 146
        const val PANEL_SET_TEMP_ID = 148
        const val PANEL_TEMP_LENGTH = 20

        const val POWER_ON = 1f
        const val POWER_OFF = 0f
        const val WIND_LOW = 1f
        const val WIND_HIGH = 0f
        const val MODE_COLD = 0f
        const val MODE_HOT = 1f
        const val MODE_WIND = 2f
        const val MODE_CHUSHI = 3f

//        const val ADDRESS_DEVIATION = 4

        const val PWD = "31415926"

        const val rack = 0

        const val slot = 0

        const val DBNumber = 1

        //地址类别
        const val VW = "vw"
        const val VD = "vd"
        const val VB = "vb"

        const val UNDERLINE = "_"

        const val VALUE_1 = 1F
        const val VALUE_0 = 0F

        //系统属性
        const val ATTR_TEMP = "temp"
        const val ATTR_HUMIDITY = "humidity"
        const val ATTR_PM25 = "pm25"
        const val ATTR_CARBON_DIOXIDE = "carbon_dioxide"
        const val ATTR_VOC = "voc"
        const val ATTR_MODE = "mode"
        const val ATTR_POWER = "power"
        const val ATTR_SET_TEMP = "set_temp"
        const val ATTR_LEAVE_HOME = "leave_home"
        const val ATTR_AIR_VOLUME = "air_volume"
        const val ATTR_FAULT = "fault"

        //属性标识
        const val FLAG_SYSTEM = "system"
        const val FLAG_PANEL = "panel"

        //子属性
        const val SUB_ATTR_COLD = "cold"
        const val SUB_ATTR_HOT = "hot"
        const val SUB_ATTR_VENTILATION = "ventilation"
        const val SUB_ATTR_DEHUMIDIFICATION = "dehumidification"

        const val SUB_ATTR_NONE = "none"
        const val SUB_ATTR_HAS = "has"

        const val SUB_ATTR_AIR_VOLUME_1 = "volume_1"
        const val SUB_ATTR_AIR_VOLUME_2 = "volume_2"
        const val SUB_ATTR_AIR_VOLUME_3 = "volume_3"

        const val SUB_ATTR_ON = "on"
        const val SUB_ATTR_OFF = "off"

        //parcelable传值
        const val SYSTEM_STATUS = "systemStatus"
        const val PANEL_STATUS = "panelStatus"
        const val ROOMS = "rooms"

        //系统<模式，开关，温度，湿度，co2，pm2.5，voc，离家状态>
        val SYSTEM_ATTR_IDS = arrayOf(
            FLAG_SYSTEM + UNDERLINE + ATTR_MODE,
            FLAG_SYSTEM + UNDERLINE + ATTR_POWER,
            FLAG_SYSTEM + UNDERLINE + ATTR_TEMP,
            FLAG_SYSTEM + UNDERLINE + ATTR_HUMIDITY,
            FLAG_SYSTEM + UNDERLINE + ATTR_CARBON_DIOXIDE,
            FLAG_SYSTEM + UNDERLINE + ATTR_PM25,
            FLAG_SYSTEM + UNDERLINE + ATTR_VOC,
            FLAG_SYSTEM + UNDERLINE + ATTR_LEAVE_HOME,
            FLAG_SYSTEM + UNDERLINE + ATTR_AIR_VOLUME,
            FLAG_SYSTEM + UNDERLINE + ATTR_FAULT
        )

        //面板<开关，温度，设定温度>
        val PANEL_ATTR_IDS = arrayOf(
            FLAG_PANEL + UNDERLINE + ATTR_POWER,
            FLAG_PANEL + UNDERLINE + ATTR_TEMP,
            FLAG_PANEL + UNDERLINE + ATTR_SET_TEMP,
            FLAG_PANEL + UNDERLINE + ATTR_HUMIDITY
        )

        //系统<开关开，开关关,制冷，制热，通风，除湿，离家开，离家关>
        val PLC_SUB_ATTRIBUTE_IDS = arrayOf(

            //制冷 制热 通风 除湿
            FLAG_SYSTEM + UNDERLINE + SUB_ATTR_COLD,
            FLAG_SYSTEM + UNDERLINE + SUB_ATTR_HOT,
            FLAG_SYSTEM + UNDERLINE + SUB_ATTR_VENTILATION,
            FLAG_SYSTEM + UNDERLINE + SUB_ATTR_DEHUMIDIFICATION,

            //系统开 系统关
            FLAG_SYSTEM + UNDERLINE + ATTR_POWER + UNDERLINE + SUB_ATTR_ON,
            FLAG_SYSTEM + UNDERLINE + ATTR_POWER + UNDERLINE + SUB_ATTR_OFF,

            //离家开 离家关
            FLAG_SYSTEM + UNDERLINE + ATTR_LEAVE_HOME + UNDERLINE + SUB_ATTR_ON,
            FLAG_SYSTEM + UNDERLINE + ATTR_LEAVE_HOME + UNDERLINE + SUB_ATTR_OFF,

            //面板开 面板关
            FLAG_PANEL + UNDERLINE + ATTR_POWER + UNDERLINE + SUB_ATTR_ON,
            FLAG_PANEL + UNDERLINE + ATTR_POWER + UNDERLINE + SUB_ATTR_OFF,

            //风量2 风量3
            FLAG_SYSTEM + UNDERLINE + ATTR_AIR_VOLUME + UNDERLINE + SUB_ATTR_AIR_VOLUME_2,
            FLAG_SYSTEM + UNDERLINE + ATTR_AIR_VOLUME + UNDERLINE + SUB_ATTR_AIR_VOLUME_3
        )
    }
}